import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Form';
import { useI18n } from '/@/hooks/web/useI18n';

const { t } = useI18n();

export function getVersionShowColumns(): BasicColumn[] {
  return [
    {
      title: t('routes.components.versionDisplay.partNo'),
      dataIndex: 'partNo',
      width: 200,
      fixed: 'left',
    },
    {
      title: t('routes.components.versionDisplay.partName'),
      dataIndex: 'partName',
      width: 200,
    },
    {
      title: t('routes.components.versionDisplay.version'),
      dataIndex: 'version',
      width: 200,
    },
    {
      title: t('routes.components.versionDisplay.status'),
      dataIndex: 'status',
      width: 200,
    },
    {
      title: t('routes.components.versionDisplay.partType'),
      dataIndex: 'partType',
      width: 200,
    },
    {
      title: t('routes.components.versionDisplay.drawingNo'),
      dataIndex: 'drawingNo',
      width: 200,
    },
    {
      title: t('routes.components.versionDisplay.model'),
      dataIndex: 'model',
      width: 200,
    },
    {
      title: t('routes.components.versionDisplay.effectiveTime'),
      dataIndex: 'effectiveTime',
      width: 200,
    },
    {
      title: t('routes.components.versionDisplay.creator'),
      dataIndex: 'creator',
      width: 200,
    },
    {
      title: t('routes.components.versionDisplay.createTime'),
      dataIndex: 'createTime',
      width: 200,
    },
    {
      title: t('routes.components.versionDisplay.identification'),
      dataIndex: 'identification',
      width: 200,
    },
    {
      title: t('routes.components.versionDisplay.inspector'),
      dataIndex: 'inspector',
      width: 200,
    },
  ];
}

export function getStructureDesForm(): FormSchema[] {
  return [
    {
      field: 'parentPartNo',
      component: 'Input',
      label: t('routes.components.structuralDescriptionModal.parentPartNo'),
      defaultValue: '',
      componentProps: {
        disabled: true,
      },
    },
    {
      field: 'parentPartVersion',
      component: 'Input',
      label: t('routes.components.structuralDescriptionModal.parentPartVersion'),
      defaultValue: '',
      componentProps: {
        disabled: true,
      },
    },
    {
      field: 'subPartVersion',
      component: 'Input',
      label: t('routes.components.structuralDescriptionModal.subPartVersion'),
      defaultValue: '',
      componentProps: {
        disabled: true,
      },
    },
    {
      field: 'quantity',
      component: 'Input',
      label: t('routes.components.structuralDescriptionModal.quantity'),
      defaultValue: '',
    },
    {
      field: 'remarks',
      component: 'InputTextArea',
      label: t('routes.components.structuralDescriptionModal.remarks'),
      defaultValue: '',
    },
    {
      field: 'serialNumber',
      component: 'Input',
      label: t('routes.components.structuralDescriptionModal.serialNumber'),
      defaultValue: '',
    },
    {
      field: 'view',
      component: 'Input',
      label: t('routes.components.structuralDescriptionModal.view'),
      defaultValue: '',
      componentProps: {
        disabled: true,
      },
    },
  ];
}
